Skip to main content

Multivariable Functions

Multivariable functions are functions that take multiple inputs and produce a single output.

A single-variable function might look like , where the input is a single number and the output is . A multivariable function might look like , where the input is two numbers and and the output is .

Table of Contents

Inputs to Multivariable Functions

The inputs to a function are called the domain of the function. The domain is the set of all possible inputs that the function can take. This can be extended to multivariable functions. For example, the domain of the function is all pairs of real numbers , while the domain of the function is all pairs of real numbers such that .

More formally written, for the function ,

Outputs of Multivariable Functions

The output of a function is called the range of the function. The range is the set of all possible outputs that the function can produce.

Multivariable functions can output single numbers, but sometimes they can also output vectors, matrices, or other more complex objects.

For example, this function outputs a vector:

Vector-valued functions are typically denoted with a bold letter, an arrow, or both. For example, , , or .

This function outputs a matrix:

A function is notated as . For example, the function takes two real numbers as input and outputs a single real number. More info on this can be found in the Linear Transformations notes.

Visualizing Multivariable Functions - Scalar-Valued

Multivariable functions can be visuallized in a few different ways. Unlike single-variable functions, graphs might not be sufficiently expressive to capture the behavior of a multivariable function.

Graphing

One way to visualize a multivariable function is to graph it in three dimensions. In a 2D graph, you have as the horizontal axis, which usually represents the input, and as the vertical axis, which represents the output.

Conventionally, in a 3D graph, you have and as the horizontal and vertical axes, and as the axis that represents the output. The and axes correspond to the input, and the axis corresponds to the output.

This also shows that, instead of a line of inputs, now you have an entire plane of inputs.

The graph of the function looks like a paraboloid, which is a three-dimensional parabola:

Instead of having two orthogonal axes, you now have three orthogonal axes. The and axes are the same as before, but now you have a third axis, the axis, which represents the output of the function. Consider a singular point on the graph, :

Contour Plots

Sometimes it is difficult to visualize a 3D graph. For example, the graph might be difficult to view on a computer screen or in a printed document, or you don't have access to some software that can plot 3D graphs.

One alternative is to use a contour plot. A contour plot is a 2D plot that shows the function's output as a series of contours. A contour plot can be thought of as a top-down view of the 3D graph. Each contour line represents a different output value, and the closer the lines are together, the steeper the function is at that point.

One common example of a contour plot is a topographic map, which shows the elevation of the land as a series of contour lines:

Topographic Map

The contour plot of the function looks like a series of concentric circles, which represent the different levels of the paraboloid.

Recall that a contour line is a line where the function has a constant value. So, for a function , a contour line is a line where for some constant . Therefore, we can iterate over different values of to plot the contour lines.

Visualizing Multivariable Functions - Vector-Valued

Some multivariable functions output vectors instead of scalars.

Parametric Equations

Parametric equations take a single input and produce multiple outputs. Usually, you can graph these outputs as a series of points in space.

For example:

This function takes a single input and produces a vector .

Let's consider how this function is applied on one point, :

We can graph this single point in space:

In order to graph the entire function, we need to consider what range of inputs we want to graph. For example, if we graph the function for , we get:

When visualizing parametric equations, you can think of the input as time. Then, you sort-of trace out the path of the function as time progresses. Note that when doing this, input information is lost - you can't tell what the input was at any given point, only where the function was at that time.

Consider these two parametric functions:

If we graph these two different functions together, we can see that they trace the same path. One way to think about this is that the two functions are the same, but one is "ahead" of the other by .

To get around this, one way is to label some points on the path with the input value.

Parametric Surfaces

For functions with more dimensions, you can graph them as surfaces in space. For example, consider this function:

This function takes two inputs, and , and produces a three-dimensional vector in space. Hence, it can be visualized as a mapping from a plane to a surface in space.

Consider the inputs and . This can be drawn as a square in the input plane:

For every point in this square, there is a corresponding point in the output 3D space. Doing this for all points in the square gives us a surface, and we can visualize this transformation:

Vector Fields

Another way to visualize vector-valued functions is with vector fields. This works for any function that takes a point in space and outputs a vector.

For example, consider the function . This function takes a point and outputs the vector .

We can place a vector on some points in space, where the vector is the output of the function at that point:

One visual example of a vector field is the flow of water in a river.

Vector fields are often denoted with an uppercase letter with an arrow on top, like . They are very common in physics and engineering, where they are used to describe forces, velocities, electric fields, and generally, any physical vector quantity that exists at every point in space.

A non-example of a physical quantity as a vector field is a temperature field. While it indeed exists at every point in space, temperature is a scalar quantity, not a vector quantity.

Choosing the Right Visualization

When visualizing multivariable functions, it is important to choose the right visualization for the function.

The main method for choosing the right visualization is to consider the dimensions for both the input and output of the function.

For a function , where is the number of inputs and is the number of outputs, you can use the following guidelines:

  1. If (more inputs than outputs), you can usually just use a regular graph or a contour plot.
  2. If (same number of inputs and outputs), you can use a vector field.
  3. If (more outputs than inputs), you can use a parametric plot/surface.